using UnityEngine;
using System.Collections;

/// \class  gkRigidBodyPhysicComponent
/// \brief  Physic component for actor with rigid body physic
[AddComponentMenu("GK/Engine/Core/Physic/gkRigidBodyPhysicController")]
[RequireComponent (typeof (Rigidbody))]
public class gkRigidBodyPhysicController : gkPhysicController
{
    /// \brief  Called after total linear velocity change
    protected override void OnLinearVelocityChange()
	{
        // Movement
        rigidbody.velocity = GetLinearVelocity();
    }

    // \brief  Make the angular movement
    protected override void OnAngularVelocityChange()
    {
        // Movement
        rigidbody.angularVelocity = Mathf.Deg2Rad * GetAngularVelocity();
    }
}